import {createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw, RouterOptions} from 'vue-router'

const routes= [
  {
    path: '/',
    redirect: '/install'
  },
  {
    path: '/home',
    component: () => import('../views/home/home.vue'),
    redirect: '/platformAuth',
    children: [
      {
        path: '/platformAuth',
        component: () => import('../views/home/authorize/authorize.vue')
      },
      {
        path: '/platformConfig',
        component: () => import('../views/home/config/config.vue')
      },
      {
        path: '/platformLogcat',
        component: () => import('../views/home/logcat/logcat.vue')
      },
      {
        path: '/platformInfo',
        component: () => import('../views/home/about/about.vue')
      },
      {
        path: '/authAgreement',
        component: () => import('../views/home/authorize/authAgrement.vue')
      },
    ]
  },
  {
    path: '/install',
    component: () => import('../views/install/index.vue')
  },
  {
    path: '/installAgreement',
    component: () => import('../views/install/agreement.vue')
  },
  {
    path: '/installProgress',
    component: () => import('../views/install/progress.vue')
  },
  {
    path: '/installResult',
    component: () => import('../views/install/result.vue')
  },
  {
    path: '/login',
    component: () => import('../views/login/login.vue')
  }
]

export const router = createRouter({
  history: createWebHashHistory(),
  routes
} as RouterOptions)
